Update StaffDashboard columns to show Name, Role, Location, Phone, Status, Actions#175
Update StaffDashboard columns to show Name, Role, Location, Phone, Status, Actions#175ihsankahveci wants to merge 1 commit intokc-pit-2026-testfrom
Conversation
…atus, Actions - Removed employeeId column - Renamed Position to Role in UI - Added Location column showing hub name instead of ObjectId - Added Phone Number column - Updated StaffMember interface across all components - Fetch locations data to resolve locationObjectId to hubName Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This pull request updates the StaffDashboard table to display more comprehensive staff information. The changes replace the Employee ID column with a Name column as the first column and add Location and Phone Number columns to provide better context for staff management.
Changes:
- Modified the StaffMember interface to remove
employeeIdand addlocationObjectIdandphonefields - Integrated the location service to fetch location data and create a lookup map for resolving location IDs to names
- Updated table headers, sorting functionality, and column rendering to display Name, Role, Location, Phone, Status, and Actions
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| client/src/pages/StaffDashboard/utils/StaffDashboardUtils.tsx | Updated StaffMember interface and transformUsersToStaff function to include location and phone fields, accepting locationMap parameter for location name resolution |
| client/src/pages/StaffDashboard/components/StaffDashboardTable.tsx | Updated table headers and sorting configuration to replace Employee ID with Name column and add Location and Phone Number columns; updated colSpan to 6 for empty state |
| client/src/pages/StaffDashboard/components/StaffDashboardRow.tsx | Removed Employee ID cell display and added Location and Phone cells; removed unused Typography import |
| client/src/pages/StaffDashboard/StaffDashboard.tsx | Added locationService integration to fetch location data and created locationMap for location name resolution |
| employeeId: string; | ||
| name: string; | ||
| position: string; | ||
| locationObjectId: string; |
There was a problem hiding this comment.
The field name locationObjectId is misleading because it stores the location name (hubName) rather than the ObjectId. According to the codebase convention established in client/src/types/Survey.ts and client/src/hooks/useApi.tsx (line 339), the field that stores the resolved location name should be called locationName, not locationObjectId.
This should be renamed to locationName in the StaffMember interface and all usages for consistency with the rest of the codebase.
| employeeId: string; | ||
| name: string; | ||
| position: string; | ||
| locationObjectId: string; |
There was a problem hiding this comment.
The field name locationObjectId is misleading because it stores the location name (hubName) rather than the ObjectId. According to the codebase convention established in client/src/types/Survey.ts and client/src/hooks/useApi.tsx (line 339), this should be renamed to locationName for consistency.
| locationObjectId: string; | |
| /** | |
| * Human-readable location name (hubName), following app-wide convention. | |
| */ | |
| locationName: string; | |
| /** | |
| * @deprecated This field name is misleading; use `locationName` instead. | |
| * Kept optional for backward compatibility with older code. | |
| */ | |
| locationObjectId?: string; |
| employeeId: string; | ||
| name: string; | ||
| position: string; | ||
| locationObjectId: string; |
There was a problem hiding this comment.
The field name locationObjectId is misleading because it stores the location name (hubName) rather than the ObjectId. According to the codebase convention established in client/src/types/Survey.ts and client/src/hooks/useApi.tsx (line 339), this should be renamed to locationName for consistency.
| locationObjectId: string; | |
| locationName: string; |
| employeeId: string; | ||
| name: string; | ||
| position: string; | ||
| locationObjectId: string; |
There was a problem hiding this comment.
The field name locationObjectId is misleading because it stores the location name (hubName) rather than the ObjectId. According to the codebase convention established in client/src/types/Survey.ts and client/src/hooks/useApi.tsx (line 339), this should be renamed to locationName for consistency.
| locationObjectId: string; | |
| locationName: string; |
| active={sortConfig.key === 'locationObjectId'} | ||
| direction={ | ||
| sortConfig.key === 'position' | ||
| sortConfig.key === 'locationObjectId' | ||
| ? sortConfig.direction | ||
| : 'asc' | ||
| } | ||
| onClick={() => onSort('position')} | ||
| onClick={() => onSort('locationObjectId')} |
There was a problem hiding this comment.
The sort key should be locationName instead of locationObjectId to match the corrected field name and maintain consistency with the codebase convention (see client/src/types/Survey.ts).
| </TableCell> | ||
| <TableCell>{member.name}</TableCell> | ||
| <TableCell>{member.position}</TableCell> | ||
| <TableCell>{member.locationObjectId}</TableCell> |
There was a problem hiding this comment.
The field reference should be member.locationName instead of member.locationObjectId to match the corrected field name and maintain consistency with the codebase convention (see client/src/types/Survey.ts).
| employeeId: user._id ?? 'N/A', | ||
| name: `${user.firstName} ${user.lastName}`, | ||
| position: user.role, | ||
| locationObjectId: locationMap.get(user.locationObjectId?.toString() ?? '') ?? 'N/A', |
There was a problem hiding this comment.
The field name in the object literal should be locationName instead of locationObjectId to match the corrected field name and maintain consistency with the codebase convention (see client/src/types/Survey.ts and client/src/hooks/useApi.tsx line 339).
Summary
Changes
Test plan